#ifndef DEADOUTPUTBOX_H_JM_20130303
#define DEADOUTPUTBOX_H_JM_20130303

#include "StreamWriterBox.h"

#include <iostream>
#include <sstream>

namespace jm4bbx {

	class  DeadOutputBox : public StreamWriterBox {
	public:
		DeadOutputBox(const BoxParamPack& pack): StreamWriterBox(pack)/*, counter_(0)*/ { }
		virtual ~DeadOutputBox() { }


		struct DeadOutputStream : public StreamWriterBox::OutputStream {

			virtual bool open() { return true; };
			virtual bool close() { return true; };
			virtual DeadOutputStream& operator<<(const std::string& str) override {
				return *this;
			}				
		};

		virtual StreamWriterBox::OutputStream& getOutputStream() override {
			static DeadOutputStream stream;
			return stream;
		}

		virtual void syncMachEtwas() override {
			//GroupPtr g = getGroupPtr(INPUT_GROUP);
			//if (g->isPoisoned() || areSignalsInPoisoned()) {
			//	std::stringstream stream;
			//	stream << getBoxInstanceId() << " : " << counter_ ;
			//	std::cout << stream.str() << std::endl;
			//}

			//counter_ += g->getReadEnd() - g->getReadPosition();
			wait4Receive();
		}
	private:
		//size_t counter_;
	};

} // namespace jm4bbx


#endif
